#!/bin/bash
echo "Start of add_conimbo_user.sh"
echo "Setting up conimbo user"
adduser --disabled-login --gecos "Conimbo,,," conimbo
echo conimbo:conimbo | chpasswd
adduser conimbo www-data
echo "Add conimbo user commands for apache reload and solr cleanup to sudoers"
rm -f /tmp/sudoers.new
cp /etc/sudoers /tmp/sudoers.new
echo "conimbo ALL=NOPASSWD: /usr/sbin/apache2ctl graceful" >> /tmp/sudoers.new
echo "conimbo ALL=NOPASSWD: /bin/rm -r /var/lib/solr/*" >> /tmp/sudoers.new
EDITOR="cp /tmp/sudoers.new" visudo
echo "End of add_conimbo_user.sh"
